package com.wx.forum.exception;

import com.wx.forum.common.AppResult;

/**
 * 异常处理
 */
public class ApplicationException extends RuntimeException{
    private AppResult errorResult;

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());//初始化父类
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }

    public AppResult getErrorResult() {
        return errorResult;
    }
}
